const { defineConfig } = require('@vue/cli-service')
const pxtorem = require('postcss-pxtorem')
module.exports = defineConfig({
  lintOnSave: false,
  pages: {
    index: {
      template: 'public/index.html',
      entry: 'src/main.js'
    }
  },
  transpileDependencies: true,
  css: {
    loaderOptions: {
      postcss: {
        postcssOptions: {
          plugins: [
            pxtorem({
              rootValue: 37.5,
              propList: ['*']
            })
          ]
        }
      }
    }
  },
  devServer: {
    // open:true,
    port: 16666,
    proxy: {
      '/apis': {
        target: 'http://www.shuiyue.info:26666',
        // changeOrigin: true, //打开跨域传递
        pathRewrite: { '/apis': '' }
      },
      '/rap': {
        target: 'http://rap2api.taobao.org/app/mock/300068',
        changeOrigin: true, // 打开跨域传递,
        pathRewrite: { '/rap': '' }
      },
      // https://xiongmaoyouxuan.com/api/tabs?sa=
      '/tab': {
        target: 'https://xiongmaoyouxuan.com',
        changeOrigin: true, // 打开跨域传递,
        pathRewrite: { '/tab': '' }
      }
    }
  }
})
